package com.gsi.multichannel.sf.pipelet;

import com.intershop.beehive.core.capi.naming.NamingMgr;
import com.intershop.beehive.core.capi.pipeline.Pipelet;
import com.intershop.beehive.core.capi.pipeline.PipelineDictionary;
import com.intershop.beehive.xcs.capi.product.Product;
import com.intershop.beehive.xcs.capi.product.ProductMgr;
import com.intershop.beehive.xcs.internal.product.ProductPO;

/**
 * 
 */
public class GetCustomAttribute extends Pipelet
{

    public static final String DN_UUID = "uuid";

    private ProductMgr manager;

    public static final String DN_PRODUCT = "product";
    
    public int execute(PipelineDictionary dict)
    {        
        String uuid = dict.getOptional(DN_UUID);
        manager = (ProductMgr)NamingMgr.getInstance().lookupManager(ProductMgr.REGISTRY_NAME);
        dict.put(DN_PRODUCT, manager.getProductByUUID(uuid));
        return PIPELET_NEXT;
    }
}